"""
员工相关模式
"""
from pydantic import BaseModel
from typing import Optional
from decimal import Decimal
from .base import BaseSchema, TimestampMixin


class EmployeeBase(BaseModel):
    """员工基础模式"""
    employee_no: str
    name: str
    department_id: int
    position: Optional[str] = None
    phone: Optional[str] = None
    email: Optional[str] = None
    rpl_efficiency: Optional[Decimal] = 0.00


class EmployeeCreate(EmployeeBase):
    """创建员工"""
    pass


class EmployeeUpdate(BaseModel):
    """更新员工"""
    employee_no: Optional[str] = None
    name: Optional[str] = None
    department_id: Optional[int] = None
    position: Optional[str] = None
    phone: Optional[str] = None
    email: Optional[str] = None
    status: Optional[str] = None
    rpl_efficiency: Optional[Decimal] = None


class EmployeeResponse(EmployeeBase, TimestampMixin, BaseSchema):
    """员工响应"""
    id: int
    status: str
